package com.test;

        import com.qfedu.bean.HpRecover;
        import com.qfedu.bean.PageVo;
        import com.qfedu.service.IHpRecoverService;
        import com.qfedu.service.impl.HpRecoverServiceImpl;
        import org.junit.Test;
        import org.junit.runner.RunWith;
        import org.springframework.beans.factory.annotation.Autowired;
        import org.springframework.test.context.ContextConfiguration;
        import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
        import org.springframework.web.bind.annotation.RequestMapping;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:spring-mybatis.xml")
public class test01 {
    @Autowired
    private IHpRecoverService  hpRecoverService ;
    @Test
    public void test(){
        System.out.println(hpRecoverService);
        HpRecover hpRecover = hpRecoverService.selectById(1);
        System.out.println(hpRecover);
    }
    @Test
    public void test2(){
        System.out.println(hpRecoverService);
        HpRecover hpRecover = new HpRecover();
        hpRecover.setHp(100);
        hpRecover.setName("初级hp恢复药剂");
        hpRecover.setCd(10);
        hpRecover.setImg(null);
        hpRecoverService.insert(hpRecover);

    }
    @Test
    public void test3(){
        hpRecoverService.deleteById(6);
    }
    @Test
    public void test4(){
        System.out.println(hpRecoverService);
        HpRecover hpRecover = new HpRecover();
        hpRecover.setId(1);
        hpRecover.setHp(100);
        hpRecover.setName("初级hp恢复药剂");
        hpRecover.setCd(10);
        hpRecover.setImg(null);
        hpRecoverService.update(hpRecover);
    }
    @Test
    public void  test5(){
        System.out.println(hpRecoverService.selectAll());
    }
    @Test
    public void test6(){
        PageVo vo = new PageVo();
        vo.setName("%初级%");
        System.out.println(hpRecoverService.selectByBage(vo));
    }
    @Test
    public void test7(){
        System.out.println(hpRecoverService.count());
    }
}
